#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int climbStairs(int n)
{
    if (n == 1)
    {
        return 1;
    }
    if (n == 2)
    {
        return 2;
    }
    int sum = 0;
    int a = 1, b = 2;
    for (int i = 3; i <= n; i++)
    {
        sum = a + b;
        a = b;
        b = sum;
    }
    return sum;
}
int main()
{
    int n = 4;
    printf("%d\n", climbStairs(n));
    return 0;
}